﻿namespace WPForms.Phone.ViewModel
{
    using System;
    using System.Net;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Documents;
    using System.Windows.Ink;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Animation;
    using System.Windows.Shapes;
    using PhoneUtils.Services;

    /// <summary>
    /// This class serves as a base class for an application view model locator.
    /// Contains properties needed for the WPForms framework.
    /// Subclasses should add more properties to the locator.
    /// </summary>
    /// <remarks>
    /// If a resource with "ViewModelLocator" key is not found when bootrapping the framework,
    /// a new instance of the  <see cref="ViewModelLocatorBase"/> will be added to the app
    /// resources.
    /// </remarks>
    public class ViewModelLocatorBase
    {
        /// <summary>
        /// Gets the create form view model.
        /// </summary>
        public ViewModel.CreateFormViewModel CreateForm
        {
            get
            {
                return ContainerLocator.Current.Resolve<ViewModel.CreateFormViewModel>();
            }
        }

        /// <summary>
        /// Gets the form collection view model.
        /// </summary>
        public ViewModel.FormCollectionViewModel FormCollection
        {
            get
            {
                return ContainerLocator.Current.Resolve<ViewModel.FormCollectionViewModel>();
            }
        }

        /// <summary>
        /// Gets the form view model.
        /// </summary>
        public ViewModel.FormViewModel Form
        {
            get
            {
                return ContainerLocator.Current.Resolve<ViewModel.FormViewModel>();
            }
        }
    }
}
